#ifndef __ROA_ROBOT_CONTROL_H_
#define __ROA_ROBOT_CONTROL_H_
#include <ros/ros.h>
#include <ros/timer.h>  
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sstream> 
#include <fstream>
#include <yaml-cpp/yaml.h>
#include <iostream>
#include <Eigen/Core>                   
#include <unistd.h>                 
#include <pthread.h>
#include <ros/ros.h>
#include <std_msgs/Bool.h>
#include <std_msgs/UInt8.h>
#include <sstream>
#include <signal.h>
#include <sstream>  
#include "std_msgs/String.h"  //包含了使用的数据类型
#include "geometry_msgs/PoseStamped.h"
#include <visualization_msgs/Marker.h>
#include <visualization_msgs/MarkerArray.h>
#include <move_base_msgs/MoveBaseActionResult.h>
#include <actionlib_msgs/GoalID.h>
#include <std_msgs/Float32.h>
#include <std_msgs/UInt8.h>
#include "tf/transform_datatypes.h"
#include "tf/transform_listener.h"
#include <geometry_msgs/PoseWithCovarianceStamped.h>
#include "ros_mec_msg/york.h"

typedef unsigned char      u8;
/*************************************************************************/
using namespace std;
/*************************************************************************/
pthread_t thread_zkwl_robot,thread_move_base,thread_slam_karto,thread_save_map,thread_rviz_start;

ros::Subscriber robot_control_sub;
ros::Subscriber cruise_point_sub;
ros::Subscriber movebase_result_sub;
ros::Subscriber pos_sub;
ros::Subscriber power_sub;
ros::Subscriber zkwl_robot_sub;

ros::Publisher  robot_status_pub;
ros::Publisher  markarray_pub;
ros::Publisher  movebase_cancel_pub;
ros::Publisher  powerpoint_pub;
ros::Publisher  goal_pub;
ros::Publisher  go_charge_pub;
ros::Publisher  power_pub;

ros::Timer movebase_timer;


//mark
visualization_msgs::Marker powerpointmark,marker,markertext;
visualization_msgs::MarkerArray mark_cruise_poit_array;
unsigned int mark_count = 0;
unsigned int move_base_status = 0;
unsigned int go_charge_status = 0;
u8           go_charge_error_cnt = 0;
u8           go_charge_sucess_flag = 0;
unsigned int go_charge_temp_movebase_status = 0;
unsigned int move_base_timer = 0;

Eigen::Vector3d TempPower_point;

std::string min_power,max_power,go_power,check_power,file_pwd;


void clear_cruisepoint();
void move_base_cancel();
void timer_handler(const ros::TimerEvent& e );
void set_goal(std::string frame,double x,double y,double z,double w);
void powerPointSet(void);
void goto_power_point(void);
void goto_power_save(void);
void update_pose(void);

static void charge_control(u8 mode);


#endif


